Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give Setup webview a single section #3448

Merged
merged 3 commits into from
Mar 14, 2023
Merged

Give Setup webview a single section #3448

merged 3 commits into from
Mar 14, 2023

Conversation

mattseddon
Copy link
Member

2/2 main <- #3440 <- this

This is exactly the same PR as #3441 which was merged in error. I have manually reverted that changed and replaced it with this PR.

This PR uses the shared component created in #3440 to give the Setup webview a single section.

Demo

Screen.Recording.2023-03-10.at.3.26.06.pm.mov

Note: This looks odd now but there will be a section above for the walkthrough and one below for Studio. I will also condense the EmptyStates to EmptySections (isFullScreen=false)

Base automatically changed from create-shared-component to main March 12, 2023 22:00
}

if (!hasData) {
return <NoData />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid too many return statements within this function.

}

if (hasData === undefined) {
return <EmptyState>Loading Project...</EmptyState>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid too many return statements within this function.

return <NoData />
}

return <EmptyState>{"You're all setup"}</EmptyState>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid too many return statements within this function.

pythonBinPath: string | undefined
}

export const SetupExperiments: React.FC<SetupExperimentsProps> = ({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SetupExperiments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.

return <CliIncompatible checkCompatibility={checkCompatibility} />
}

if (cliCompatible === undefined) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

@@ -8,3 +8,13 @@ export type SetupData = {
projectInitialized: boolean
pythonBinPath: string | undefined
}

export enum Section {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this enum name unique (as well as the one in plot)? Importing after typing only section might be confusing if the wrong Section is imported.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually got hit by this already. I will update after #3452.

@mattseddon mattseddon enabled auto-merge (squash) March 14, 2023 22:36
@codeclimate
Copy link

codeclimate bot commented Mar 14, 2023

Code Climate has analyzed commit 916e1a9 and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 4
Duplication 1

The test coverage on the diff in this pull request is 92.5% (85% is the threshold).

This pull request will bring the total coverage in the repository to 95.7% (0.1% change).

View more on Code Climate.

@mattseddon mattseddon merged commit 40e7d96 into main Mar 14, 2023
@mattseddon mattseddon deleted the give-setup-section branch March 14, 2023 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants